WDV221 Intro Javascript
Comparison and IF Statements - Compare Names Assignment
Please complete the following exercises on this page. When complete post this page to your server. Make a link in your WDV221 homework page for this assignment.
Include a comment in each script with the exercise number and a description of what the script is supposed to do.
Submit this assignment on Canvas and include a link to your homework page or home page of your hosting account.
Result
Instructions:
- Create a function called compareNames( ).
- The function will compare the two input values from the form above.
- The comparison should be case insensitive.
- The results should display "Same" or "Different".
- The input fields should be validated. The validations should not allow an empty field.
- Use a span element and its .innerHTML property to display the results.
- Provide a reset function that will reset the form and results.
- Place both functions in an external script file called compareNames.js.